﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.SessionState;

using System.Web.Routing;

namespace Pep_3014_3070
{
    public class Global : System.Web.HttpApplication
    {

        protected void Application_Start(object sender, EventArgs e)
        {
            RegisterRoutes(RouteTable.Routes);

        }
        //Routes
        private void RegisterRoutes(RouteCollection routes)
        {

            routes.Add(new Route("{resource}.axd/{*pathInfo}", new StopRoutingHandler()));
            routes.Add(new Route("{service}.asmx/{*pathInfo}", new StopRoutingHandler()));

            //Error page 
            routes.MapPageRoute("PageNotFound", "404", "~/Anonymous/PageNotFound.aspx");
            routes.MapPageRoute("ErrorPage", "Error", "~/Anonymous/Error.aspx");

            //Anonymous

            routes.MapPageRoute("Naslovna", "Home", "~/Anonymous/Home.aspx");
            routes.MapPageRoute("Pregled Apartmana", "Details/{id}", "~/Anonymous/ApartmanDetails.aspx");
            routes.MapPageRoute("Registracija Klijenata", "NewCustomer", "~/Anonymous/NewCustomer.aspx");
            routes.MapPageRoute("Registracija Vlasnika Apartmana", "NewOwner", "~/Anonymous/NewOwner.aspx");
            routes.MapPageRoute("Registracija zaposlenih", "NewEmployee", "~/Anonymous/NewUser.aspx");
            routes.MapPageRoute("Aktivacija racuna", "ActivateAccount/{id}-{email}", "~/Anonymous/ActivateAccount.aspx");

            routes.MapPageRoute("Prijava", "Login", "~/Anonymous/Login.aspx");

            //Owners

            routes.MapPageRoute("Dodavanje apartmana", "NewApartman", "~/Owners/NewApartman.aspx");
            routes.MapPageRoute("Home stranica Vlasnika", "OwnersHome", "~/Owners/OwnersHome.aspx");
            routes.MapPageRoute("Pregled i editovanje Apartmana", "OwnerApartmants", "~/Owners/OwnerApartmans.aspx");
            routes.MapPageRoute("Editovane apartmana ", "ApartmanDetails/{id}", "~/Owners/ApartmanDetails.aspx");
            routes.MapPageRoute("Potvrda rezervacije ", "ConfirmReservation", "~/Owners/ConfirmReservation.aspx");
            routes.MapPageRoute("Profil Owner", "ProfileOwner/{id}", "~/Owners/ProfilePage.aspx");

            //Users
            routes.MapPageRoute("Home stranica Administrativnog osoblja", "UsersHome", "~/Users/UsersHome.aspx");

            //Customers
            routes.MapPageRoute("Home stranica Klijenata", "CustomersHome", "~/Customers/CustomersHome.aspx");
            routes.MapPageRoute("Rezervacija apartmana za registrovane korisnike", "Reservation/{id}", "~/Customers/Reservation.aspx");
            routes.MapPageRoute("Historija rezerviranih apartmana", "HistoryReservation", "~/Customers/HistoryReservation.aspx");
            routes.MapPageRoute("Profil Customersa", "ProfileCustomer/{id}", "~/Customers/ProfilePage.aspx");
            routes.MapPageRoute("Pregled profila vlasnika", "Owner/{id}", "~/Customers/Owner.aspx");
            //Logout
            routes.MapPageRoute("Odjava", "Logout", "~/Anonymous/Logout.aspx");

        }
        protected void Session_Start(object sender, EventArgs e)
        {

        }

        protected void Application_BeginRequest(object sender, EventArgs e)
        {

        }

        protected void Application_AuthenticateRequest(object sender, EventArgs e)
        {

        }

        protected void Application_Error(object sender, EventArgs e)
        {

        }

        protected void Session_End(object sender, EventArgs e)
        {

        }

        protected void Application_End(object sender, EventArgs e)
        {

        }
    }
}